var notyf = new Notyf({delay:3000});

$("#menuItemRecentCode").click(function () {
    $.getJSON("/api/getCodeHistory", function (res) {
        if (res.code == 0) {
            var len = res.data.length;
            var data = res.data;
            var fileCodeStr = '';
            for (var i = 0; i < len; i++) {
                fileCodeStr += "<br>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;" + data[i];
            }

            $("#fileCodeList").html(fileCodeStr);

            document.getElementById("recentModalLink").click();
        } else {
            notyf.alert(res.msg);
        }
    });
});